 <%
 	// fetch the file
	java.io.BufferedInputStream bis=null;
	java.io.BufferedOutputStream  bos=null;
	try{
	String fileName=request.getParameter("fileName");
	String filePath = request.getParameter("filePath");
	
	response.setContentType("application/x-msdownload");
	response.setHeader("Content-disposition","attachment; filename="+new String(fileName.getBytes("GBK"),"iso8859-1"));
	bis =new java.io.BufferedInputStream(new java.io.FileInputStream(config.getServletContext().getRealPath(filePath)));
	bos=new java.io.BufferedOutputStream(response.getOutputStream());
	byte[] buff = new byte[2048];
	int bytesRead;
	while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
	bos.write(buff,0,bytesRead);
	
	}
	}
	catch(Exception e){
	e.printStackTrace();
	}
	finally {
	
	if (bos != null){
		bos.close();
		out.clear();
		out = pageContext.pushBody();
	}
	
	if (bis != null)bis.close();
	
	}

%>